/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bm.model;

import java.io.Serializable;

/**
 *
 * @author IT
 */
public interface IMessage extends Serializable {

    /**
     * Message field delimiter.
     */
    public String DELIMETER = "*";
    /**
     * Predefined content for bad message.
     */
    public String BAD = "BAD";
    /**
     * Index of message type indicator field.
     */
    public int FIELD_MTI = 0;
    /**
     * Field of product code.
     */
    public int FIELD_KODE_PRODUK = 1;
    /**
     * Index of message type indicator.
     */
    public int FIELD_MID = 2;
    /**
     * Index of processing step.
     */
    public int FIELD_STEP = 3;
    /**
     * Index of transaction datetime.
     */
    public int FIELD_DATETIME = 4;
    /**
     * Index of transaction via.
     */
    public int FIELD_VIA = 5;
    /**
     * The number of reserved field used by this interface. The implementors
     * should start from the next higher index.
     */
    public int LAST_INDEX = 5;

    /**
     * Assign a value into a specified field.
     *
     * @param key index of the field
     * @param value value to be assigned
     */
    public void setItem(int key, String value);

    /**
     * Get the value of a specified field.
     *
     * @param key index of the field
     * @return the field's value
     */
    public String getItem(int key);
}
